home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / vis082s.arc / OTHERS.PAS < prev    next >
Pascal/Delphi Source File  |  1991-04-17  |  39KB  |  1,454 lines

  1. {$R-,S-,I-,D-,F+,V-,B-,N-,L+,O+ }
  2.  
  3. unit others;
  4.  
  5. interface
  6.  
  7. uses crt,dos,
  8. gentypes,configrt,modem,statret,gensubs,subs1,windows,subs2,textret,
  9.      mailret,userret,flags,mainr1,ansiedit,lineedit,
  10.      mainr2,overret1;
  11.  
  12.  
  13. procedure showuserstats(u:userrec);
  14. procedure edituser (eunum:integer);
  15. procedure printnews;
  16. function selectspecs (var us:userspecsrec):boolean; { True if user aborts }
  17. procedure editoldspecs;
  18. procedure readfeedback;
  19. procedure showallsysops;
  20. procedure editusers;
  21. procedure zapspecifiedusers;
  22. Procedure RemoteDosShell;
  23.  
  24. implementation
  25.  
  26.  
  27.  
  28. procedure delallmail (n:integer);
  29. var cnt,delled:integer;
  30.     m:mailrec;
  31.     u:userrec;
  32. begin
  33.   cnt:=-1;
  34.   delled:=0;
  35.   repeat
  36.     cnt:=searchmail(cnt,n);
  37.     if cnt>0 then begin
  38.       delmail(cnt);
  39.       cnt:=cnt-1;
  40.       delled:=delled+1
  41.     end
  42.   until cnt=0;
  43.   if delled>0 then writeln (^B'Mail deleted: ',delled);
  44.   writeurec;
  45.   seek (ufile,n);
  46.   read (ufile,u);
  47.   deletetext (u.infoform);
  48.   deletetext (u.infoform2);
  49.   deletetext (u.infoform3);
  50.   deletetext (u.infoform4);
  51.   deletetext (u.infoform5);
  52.   deletetext (u.emailannounce);
  53.   u.infoform:=-1;
  54.   u.infoform2:=-1;
  55.   u.infoform3:=-1;
  56.   u.infoform4:=-1;
  57.   u.infoform5:=-1;
  58.   u.emailannounce:=-1;
  59.   writeufile (u,n);
  60.   readurec
  61. end;
  62.  
  63. procedure deleteuser (n:integer);
  64. var u:userrec;
  65. begin
  66.   delallmail (n);
  67.   fillchar (u,sizeof(u),0);
  68.   u.infoform:=-1;
  69.   u.infoform2:=-1;
  70.   u.infoform3:=-1;
  71.   u.infoform4:=-1;
  72.   u.infoform5:=-1;
  73.   u.emailannounce:=-1;
  74.   writeufile (u,n)
  75. end;
  76.  
  77.  
  78. function postcallratio (var u:userrec):real;
  79. begin
  80.   if u.numon=0
  81.     then postcallratio:=0
  82.     else postcallratio:=u.nbu/u.numon
  83. end;
  84.  
  85. function fitsspecs (var u:userrec; var us:userspecsrec):boolean;
  86. var days:integer;
  87.     pcr:real;
  88.     thisyear,thismonth,thisday,t:word;
  89.     lastcall:datetime;
  90.  
  91.   function inrange (n,min,max:integer):boolean;
  92.   begin
  93.     inrange:=(n>=min) and (n<=max)
  94.   end;
  95.  
  96. begin
  97.   unpacktime (u.laston,lastcall);
  98.   getdate (thisyear,thismonth,thisday,t);
  99.   days:=(thisyear-lastcall.year)*365+(thismonth-lastcall.month)*30+
  100.         (thisday-lastcall.day);
  101.   pcr:=postcallratio (u);
  102.   fitsspecs:=inrange (u.level,us.minlevel,us.maxlevel) and
  103.              inrange (days,us.minlaston,us.maxlaston) and
  104.              (pcr>=us.minpcr) and (pcr<=us.maxpcr);
  105.   if (datepart(u.expdate)<datepart(Now)) and us.expired and (datepart(u.expdate)<>0)
  106.   then fitsspecs:=true;
  107. end;
  108.  
  109.  
  110. procedure showuserstats(u:userrec);
  111. var knter:integer;
  112.     tpstr:lstr;
  113. begin
  114.   clearscr;
  115.   blowup(1,1,47,11);
  116.   printxy(1,3,^R'[ '^S'ViSiON User Status'^R' ]');
  117.   printxy(2,3,^R'User Handle.: '^S+u.handle);
  118.   printxy(3,3,^R'Real Name...: '^S+u.realname);
  119.   printxy(4,3,^R'User Note...: '^S+u.usernote);
  120.   printxy(5,3,^R'Main Level..: '^S+strr(u.level));
  121.   printxy(6,3,^R'Phone Number: '^S+u.phonenum);
  122.   if issysop then printxy(7,3,^R'Password....: '^S+u.password) else
  123.   printxy(7,3,^R'Password....: '^S+'[CLASSIFIED]');
  124.   printxy(8,3,^R'Last time On: '^S+datestr(u.laston));
  125.   printxy(9,3,^R'Total Calls.: '^S+strr(u.numon));
  126.   printxy(10,3,^R'Total Posts.: '^S+strr(u.nbu));
  127.  
  128.   blowup(1,50,28,8);
  129.   printxy(1,52,^R'[ '^S'Xfer Status'^R' ]');
  130.   printxy(2,52,^R'Level....: '^S+strr(u.udlevel));
  131.   printxy(3,52,^R'Points...: '^S+strr(u.udpoints));
  132.   printxy(4,52,^R'Uploads..: '^S+strr(u.uploads));
  133.   printxy(5,52,^R'Downloads: '^S+strr(u.downloads));
  134.   printxy(6,52,^R'U/L K....: '^S+strr(u.upkay));
  135.   printxy(7,52,^R'D/L K....: '^S+strr(u.dnkay));
  136.  
  137.   blowup(13,1,56,5);
  138.   tpstr:='';
  139.   for knter:=1 to 10 do begin
  140.     if knter<>1 then tpstr:=tpstr+',';
  141.     if (u.confset[knter]>0) then tpstr:=tpstr+strr(knter) else
  142.     tpstr:=tpstr+'0'
  143.   end;
  144.   printxy(14,3,^R'Sub-Conferences.: '^S);
  145.   printxy(14,21,tpstr);
  146.   tpstr:='';
  147.   for knter:=11 to 20 do begin
  148.     if knter<>11 then tpstr:=tpstr+',';
  149.     if (u.confset[knter]>0) then tpstr:=tpstr+strr(knter) else
  150.      tpstr:=tpstr+'0';
  151.   end;
  152.   printxy(15,21,tpstr);
  153.   tpstr:='';
  154.   for knter:=21 to 30 do begin
  155.     if knter<>21 then tpstr:=tpstr+',';
  156.     if (u.confset[knter]>0) then tpstr:=tpstr+strr(knter) else
  157.       tpstr:=tpstr+'0';
  158.   end;
  159.   printxy(16,21,tpstr);
  160.   printxy(20,1,'');
  161. end;
  162.  
  163. procedure edituser (eunum:integer);
  164. var eurec:userrec;
  165.     ca:integer;
  166.     k:char;
  167. const sysopstr:array [false..true] of string[6]=('Normal','Sysop');
  168.       sectionnames:array [udsysop..databasesysop] of string[20]=
  169.         ('File transfer','Bulletin section','Voting booths',
  170.          'E-mail section','Doors','Main menu','Databases');
  171.  
  172.   procedure truesysops;
  173.   begin
  174.     writeln ('Sorry, you may not do that without true sysop access!');
  175.     writelog (18,17,'')
  176.   end;
  177.  
  178.   function truesysop:boolean;
  179.   begin
  180.     truesysop:=ulvl>=configset.sysopleve
  181.   end;
  182.  
  183.   procedure getmstr (t:mstr; var mm);
  184.   var m:mstr absolute mm;
  185.   begin
  186.     writeln ('Old ',t,': '^S,m);
  187.     writestr ('New '+t+'? *');
  188.     if length(input)>0 then m:=input
  189.   end;
  190.  
  191.   procedure getsstr (t:mstr; var s:sstr);
  192.   var m:mstr;
  193.   begin
  194.     m:=s;
  195.     getmstr (t,m);
  196.     s:=m
  197.   end;
  198.  
  199.   procedure getint (t:mstr; var i:integer);
  200.   var m:mstr;
  201.   begin
  202.     m:=strr(i);
  203.     getmstr (t,m);
  204.     i:=valu(m)
  205.   end;
  206.  
  207.   procedure euwanted;
  208.   begin
  209.     writestr ('Wanted status: '^S+yesno(wanted in eurec.config));
  210.     writestr ('New wanted status:');
  211.     if yes
  212.       then eurec.config:=eurec.config+[wanted]
  213.       else eurec.config:=eurec.config-[wanted];
  214.     writelog (18,1,yesno(wanted in eurec.config))
  215.   end;
  216.  
  217.   procedure eudel;
  218.   var fnt:text; dummystr:mstr;
  219.   begin
  220.     writestr (^R'Delete user '^F+eurec.handle+^R'?  ['^A'N'^R']:');
  221.     if yes then begin
  222.       writestr(^M'Add user to the System Blacklist? *');
  223.       if yes then begin
  224.        if not exist(configset.textfiledi+'Blacklst') then begin
  225.        assign(fnt,configset.textfiledi+'Blacklst');
  226.        rewrite(fnt);
  227.        textclose(fnt);
  228.        end;
  229.        assign(fnt,configset.textfiledi+'Blacklst');
  230.        append(fnt);
  231.        writeln(fnt,eurec.handle);
  232.        textclose(fnt);
  233.        end;
  234.       deleteuser (eunum);
  235.       seek (ufile,eunum);
  236.       read (ufile,eurec);
  237.       writelog (18,9,'')
  238.     end
  239.   end;
  240.  
  241.   Procedure EuMainConference;
  242.   Var I,J:Integer;
  243.   Begin
  244.     For I:=1 to 5 Do
  245.        If Eurec.Conf[I] then WriteLn('Allowed in Main Conference #',I)
  246.        Else WriteLn('Not allowed in Main Conference #',i);
  247.     WriteStr(^M'Which Conference to Change:');
  248.     If Input='' then Else Begin
  249.     I:=Valu(Input);
  250.     If (I>0) and (I<6) then
  251.       Eurec.Conf[I]:=Not Eurec.Conf[I];
  252.     End;
  253.   End;
  254.  
  255.   procedure euname;
  256.   var m:mstr;
  257.   begin
  258.     m:=eurec.handle;
  259.     getmstr ('name',m);
  260.     if not match (m,eurec.handle) then
  261.       if lookupuser (m)<>0 then begin
  262.         writestr ('Already exists!  Are you sure? *');
  263.         if not yes then exit
  264.       end;
  265.     eurec.handle:=m;
  266.     writelog (18,6,m)
  267.   end;
  268.  
  269.   Procedure eurealname;
  270.   var m:mstr;
  271.   begin
  272.     m:=eurec.realname;
  273.     getmstr ('Real Name',m);
  274.       If m>'' then eurec.realname:=m;
  275.   end;
  276.  
  277.   Procedure euSpecialNote;
  278.   var m:mstr;
  279.   begin
  280.     m:=eurec.SpecialSysopNote;
  281.     getmstr ('Special SysOp Note',m);
  282.       If m>'' then eurec.specialsysopnote:=m;
  283.   End;
  284.  
  285.   procedure eupassword;
  286.   begin
  287.     if not truesysop
  288.       then truesysops
  289.       else begin
  290.         getsstr ('password',eurec.password);
  291.         writelog (18,8,'')
  292.       end
  293.   end;
  294.  
  295.   procedure eulevel;
  296.   var n:integer;
  297.   begin
  298.     n:=eurec.level;
  299.     getint ('level',n);
  300.     if (n>=configset.sysopleve) and (not truesysop)
  301.       then truesysops
  302.       else begin
  303.         eurec.level:=n;
  304.         writelog (18,15,strr(n))
  305.       end
  306.   end;
  307.  
  308.   procedure eutimelimit;
  309.   var n:integer;
  310.   begin
  311.     n:=eurec.timelimits;
  312.     getint('time limit',n);
  313.     eurec.timelimits:=n;
  314.   end;
  315.  
  316.   procedure eudratio;
  317.   var n:integer;
  318.   begin
  319.     n:=eurec.udratio;
  320.     getint('Upload/Download Ratio',n);
  321.     eurec.udratio:=n;
  322.   end;
  323.  
  324.   procedure eudkratio;
  325.   var n:integer;
  326.   begin
  327.        n:=eurec.udkratio;
  328.        getint('Upload/Download K Ratio',n);
  329.        eurec.udkratio:=n;
  330.   end;
  331.  
  332.   procedure epcratio;
  333.   var n:integer;
  334.   begin
  335.        n:=eurec.pcratio;
  336.        getint('Post/Call Ratio',n);
  337.        eurec.pcratio:=n;
  338.   end;
  339.  
  340.   procedure eglevel;
  341.   var n:integer;
  342.   begin
  343.   n:=eurec.glevel;
  344.   getint('G-File level',n);
  345.   if (n>=configset.sysopleve) and (not truesysop) then truesysops else eurec.glevel:=n;
  346.   end;
  347.  
  348.   procedure egfpoints;
  349.   var n:integer;
  350.   begin
  351.   n:=eurec.gpoints;
  352.   getint('G-File points',n);
  353.   eurec.gpoints:=n;
  354.   end;
  355.  
  356.   procedure euconference;
  357.   var k:integer;
  358.   begin
  359.     writehdr('User currently has the following conference flags set');
  360.     for k:=1 to 20 do
  361.         begin
  362.           if (eurec.confset[k]>0) then write(k) else write('0');
  363.           write(',');
  364.         end;
  365.         writeln('');
  366.     for k:=21 to 31 do
  367.       begin
  368.         if (eurec.confset[k]>0) then write(k) else write('0');
  369.         write(',');
  370.         end;
  371.     if (eurec.confset[32]>0) then writeln('32') else writeln('0');
  372.     writestr(^M^P'Change which flag:*');
  373.     if input='' then exit;
  374.     K:=valu(input);
  375.     if k>32 then begin
  376.        writeln(^M'That is NOT a conference!');
  377.        exit;
  378.      end;
  379.     if (eurec.confset[k]=1) then eurec.confset[k]:=0 else eurec.confset[k]:=1;
  380.   end;
  381.  
  382.   procedure euusernote;
  383.   var m:mstr;
  384.       p:integer;
  385.   begin
  386.     m:=eurec.usernote;
  387.     getmstr('Account note',m);
  388.     eurec.usernote:=m;
  389.   end;
  390.  
  391.   procedure euphone;
  392.   var m:mstr;
  393.       p:integer;
  394.   begin
  395.     m:=eurec.phonenum;
  396.     buflen:=15;
  397.     getmstr ('phone number',m);
  398.     p:=1;
  399.     while p<=length(m) do
  400.       if (m[p] in ['0'..'9'])
  401.         then p:=p+1
  402.         else delete (m,p,1);
  403.     if length(m)>7 then begin
  404.       eurec.phonenum:=m;
  405.       writelog (18,16,m)
  406.     end
  407.   end;
  408.  
  409.   procedure boardflags;
  410.   var quit:boolean;
  411.  
  412.     procedure listflags;
  413.     var bd:boardrec;
  414.         cnt:integer;
  415.     begin
  416.       seek (bdfile,0);
  417.       for cnt:=0 to filesize(bdfile)-1 do begin
  418.         read (bdfile,bd);
  419.         tab (bd.shortname,9);
  420.         tab (bd.boardname,30);
  421.         writeln (accessstr[getuseraccflag (eurec,cnt)]);
  422.         if break then exit
  423.       end
  424.     end;
  425.  
  426.     procedure changeflag;
  427.     var bn,q:integer;
  428.         bname:mstr;
  429.         ac:accesstype;
  430.     begin
  431.       buflen:=8;
  432.       writestr ('Board to change access:');
  433.       bname:=input;
  434.       bn:=searchboard(input);
  435.       if bn=-1 then begin
  436.         writeln ('Not found!');
  437.         exit
  438.       end;
  439.       writeln (^B^M'Current access: '^S,
  440.                accessstr[getuseraccflag (eurec,bn)]);
  441.       getacflag (ac,input);
  442.       if ac=invalid then exit;
  443.       setuseraccflag (eurec,bn,ac);
  444.       case ac of
  445.         letin:q:=2;
  446.         keepout:q:=3;
  447.         bylevel:q:=4
  448.       end;
  449.       writelog (18,q,bname)
  450.     end;
  451.  
  452.     procedure allflags;
  453.     var ac:accesstype;
  454.     begin
  455.       writehdr ('Set all board access flags');
  456.       getacflag (ac,input);
  457.       if ac=invalid then exit;
  458.       writestr ('Confirm [Y/N]:');
  459.       if not yes then exit;
  460.       setalluserflags (eurec,ac);
  461.       writelog (18,5,accessstr[ac])
  462.     end;
  463.  
  464.   begin
  465.     opentempbdfile;
  466.     quit:=false;
  467.     repeat
  468.       repeat
  469.         writestr (^M'L)ist flags, C)hange one flag, A)ll flags, or Q)uit:');
  470.         if hungupon then exit
  471.       until length(input)<>0;
  472.       case upcase(input[1]) of
  473.         'L':listflags;
  474.         'C':changeflag;
  475.         'A':allflags;
  476.         'Q':quit:=true
  477.       end
  478.     until quit;
  479.     closetempbdfile
  480.   end;
  481.  
  482.   procedure defualt;
  483.   begin
  484.   eurec.level:=configset.defleve;
  485.   eurec.usernote:=configset.defac;
  486.   eurec.udpoints:=configset.deffp;
  487.   eurec.udlevel:=configset.deffil;
  488.   eurec.glevel:=configset.defgfil;
  489.   eurec.gpoints:=configset.defgp;
  490.   end;
  491.  
  492.   procedure specialsysop;
  493.  
  494.     procedure getsysop (c:configtype);
  495.     begin
  496.       writeln ('Section ',sectionnames[c],': '^S,
  497.                sysopstr[c in eurec.config]);
  498.       writestr ('Grant sysop access? *');
  499.       if length(input)<>0
  500.         then if yes
  501.           then
  502.             begin
  503.               eurec.config:=eurec.config+[c];
  504.               writelog (18,10,sectionnames[c])
  505.             end
  506.           else
  507.             begin
  508.               eurec.config:=eurec.config-[c];
  509.               writelog (18,11,sectionnames[c])
  510.             end
  511.     end;
  512.  
  513.   begin
  514.     if not truesysop then begin
  515.       truesysops;
  516.       exit
  517.     end;
  518.     writestr
  519. ('Section of M)ain, F)ile, B)ulletin, V)oting, E)mail, D)atabase, P)Doors:');
  520.     if length(input)=0 then exit;
  521.     case upcase(input[1]) of
  522.       'M':getsysop (mainsysop);
  523.       'F':getsysop (udsysop);
  524.       'B':getsysop (bulletinsysop);
  525.       'V':getsysop (votingsysop);
  526.       'E':getsysop (emailsysop);
  527.       'D':getsysop (databasesysop);
  528.       'P':getsysop (doorssysop)
  529.     end
  530.   end;
  531.  
  532.   procedure getlogint (prompt:mstr; var i:integer; ln:integer);
  533.   begin
  534.     getint (prompt,i);
  535.     writelog (18,ln,strr(i))
  536.   end;
  537.  
  538. procedure IceCube;
  539. var cpu:integer;
  540. begin
  541. ClearScr;
  542. WriteLn(^R'╒═══════════════════════════════════════════════════════════════════════════╕');
  543. WriteLn(^R'│ '^P'Command '^S':                  '^O'('^U'Q'^O')uit               '^A'ViSiON v0.82 User Editor  '^R'│');
  544. WriteLn(^R'╘═══════════════════════════════════════════════════════════════════════════╛');
  545. Writeln('╒═══════════════════════════════════════════════════════════════════════════╕');
  546. Writeln('│'^P' ('^S'H'^P') User Handle :'^R'                         '^P'                              '^R'  │');
  547. Writeln('├───────────────────────────────────────────────────────────────────────────┤');
  548. Writeln('│'^P' ('^S'L'^P') Main Level   :'^R'                         '^P'('^S'C'^P') Conf 1 Access  :'^R'           │');
  549. Writeln('│'^P' ('^S'F'^P') File Level   :'^R'                         '^P'('^S'C'^P') Conf 2 Access  :'^R'           │');
  550. Writeln('│'^P' ('^S'O'^P') File Points  :'^R'                         '^P'('^S'C'^P') Conf 3 Access  :'^R'           │');
  551. Writeln('│'^P' ('^S'N'^P') Phone Number :'^R'                         '^P'('^S'C'^P') Conf 4 Access  :'^R'           │');
  552. Writeln('│'^P' ('^S'M'^P') Real Name    :'^R'                         '^P'('^S'C'^P') Conf 5 Access  :'^R'           │');
  553. Writeln('│'^P' ('^S'T'^P') Time Left    :'^R'                         '^P'('^S'W'^P') Wanted Status  :'^R'           │');
  554. Writeln('│'^P' ('^S'U'^P') User Note    :'^R'                         '^P'('^S'G'^P') Gfile Level    :'^R'           │');
  555. writeln('│'^P' ('^S'P'^P') Password     :'^R'                         '^P'('^S'+'^P') Grant Def Lvls  '^R'           │');
  556. writeLn('│'^P' ('^S'1'^P') Posted       :'^R'                         '^P'('^S'2'^P') # Of Uploads   :'^R'           │');
  557. WriteLn('│'^P' ('^S'3'^P') Uploaded K   :'^R'                         '^P'('^S'4'^P') # Of Downloads :'^R'           │');
  558. writeln('│'^P' ('^S'Z'^P') Private Note :'^R'                         '^P'('^S'5'^P') Required UDk Ratio:'^R'        │');
  559. WriteLn('│'^P' ('^S'6'^P') Required UD Ratio:'^R'                     '^P'('^S'7'^P') Required PCR:              '^R'│');
  560. Writeln('╘═══════════════════════════════════════════════════════════════════════════╛');
  561. Writeln(^R'╒═══════════════════════════════════════════════════════════════════════════╕');
  562. Writeln(^R'│ '^F'('^A'S'^F')ee User Stats ('^A'I'^F')nfoforms ('^A'B'^F')oard Flags ('^A'Y'^F') SysOp Privilages ('^A'D'^F+
  563.  ')elete  '^R'│');
  564. Writeln(^R'╘═══════════════════════════════════════════════════════════════════════════╛');
  565. printxy(5,21,eurec.handle);
  566. printxy(7,23,strr(eurec.level));
  567. printxy(8,23,strr(eurec.udlevel));
  568. printxy(9,23,strr(eurec.udpoints));
  569. printxy(10,23,eurec.Phonenum);
  570. Printxy(11,23,eurec.realname);
  571. printxy(12,23,strr(eurec.timetoday));
  572. printxy(13,23,eurec.usernote);
  573. if local Then printxy(14,23,eurec.Password) Else Printxy(14,23,'[Classified]');
  574. Printxy(15,23,strr(eurec.nbu));
  575. PrintXy(16,23,strr(eurec.upkay));
  576. PrintXy(17,23,eurec.specialsysopnote);
  577. If eurec.udratio=0 then Printxy(18,26,'N/A') Else Printxy(18,26,strr(eurec.udratio)+'%');
  578. if eurec.conf[1] then
  579. printxy(7,69,'Yes') else
  580. printxy(7,69,'No');
  581. if eurec.conf[2] then
  582. printxy(8,69,'Yes') else
  583. printxy(8,69,'No');
  584. if eurec.conf[3] then
  585. printxy(9,69,'Yes') else
  586. printxy(9,69,'No');
  587. if eurec.conf[4] then
  588. printxy(10,69,'Yes') else
  589. printxy(10,69,'No');
  590. if eurec.conf[5] then
  591. printxy(11,69,'Yes') else
  592. printxy(11,69,'No');
  593. printxy(12,69,yesno(wanted in eurec.config));
  594. Printxy(13,69,strr(Eurec.glevel));
  595. Printxy(15,69,strr(eurec.uploads));
  596. PrintXy(16,69,strr(eurec.downloads));
  597. If eurec.UDKratio=0 then printxy(17,70,'N/A') Else Printxy(17,70,strr(eurec.UDKratio)+'%');
  598. If eurec.pcratio=0 then printxy(18,64,'N/A') Else Printxy(18,64,strr(eurec.Pcratio)+'%');
  599. goxy(2,2);
  600. Write(^P' Command'^S' :');
  601. end;
  602.  
  603. procedure choose;
  604. var
  605. gg:char;
  606. tmp,cpu:integer;
  607. imdone:boolean;
  608.     procedure gox;
  609.        Begin
  610.        GoXY(1,23);
  611.        End;
  612.       Begin
  613.       Repeat
  614.       icecube;
  615.         GG:=' ';
  616.         Repeat
  617.           Repeat
  618.           If hungupon Then exit;
  619.           Until charready Or hungupon;
  620.           gg:=readchar;If Length(GG)=0 Then GG:=' ';GG:=UpCase(GG);
  621.         Until (Pos(GG,'HDLFONMTUPSBIYCWGZ1234567+Q')>0) or hungupon;
  622.         if gg='H' then begin
  623.         gox;
  624.         euname;
  625.         end;
  626.        if gg='D' then begin
  627.        gox;
  628.        eudel;
  629.        end;
  630.        if gg='L' then  begin
  631.        gox;
  632.        eulevel;
  633.        end;
  634.        if gg='F' then begin
  635.        gox;
  636.        getlogint('u/d level',eurec.udlevel,14);
  637.        end;
  638.        if gg='O' then begin
  639.        gox;
  640.        Getlogint('u/d points',eurec.udpoints,7);
  641.        end;
  642.        if gg='N' then begin
  643.        gox;
  644.        euphone;
  645.        end;
  646.        if gg='M' then begin
  647.        gox;
  648.        eurealname;
  649.        end;
  650.        if gg='T' then begin
  651.        gox;
  652.         getlogint('time for today',eurec.timetoday,12);
  653.         end;
  654.         if gg='U' then  begin
  655.         gox;
  656.         euusernote;
  657.         end;
  658.         if gg='P' then  begin
  659.         gox;
  660.         if local Then eupassword;
  661.         if unum=1 then eupassword;
  662.         end;
  663.         if gg='S' then  begin
  664.         gox;
  665.         ShowUserStats(eurec);
  666.         WriteSTr(^O'Press '^F'['^A'Enter'^F']:*');
  667.         end;
  668.         if gg='B' then  begin
  669.         gox;
  670.        boardflags;
  671.        end;
  672.        if gg='I' then begin
  673.        gox;
  674.        begin
  675.           writestr(^M^P'Which infoform to view [1-5] ['^A'1'^P']:*');
  676.           if input='' then input:='1';
  677.           tmp:=valu(input);
  678.           if (tmp>0) and (tmp<6) then Begin
  679.            showinfoforms(strr(eunum),tmp);
  680.            WriteStr(^O'Press '^F'['^A'Enter'^F']:*');
  681.            End;
  682.           end;
  683.        end;
  684.        if gg='Y' then begin
  685.        gox;
  686.       SpecialSysop;
  687.       end;
  688.       if gg='C' then begin
  689.       gox;
  690.       EuMainConference;
  691.       end;
  692.       if gg='W' then begin
  693.       gox;
  694.       euwanted;
  695.       end;
  696.       if gg='G' then begin
  697.       gox;
  698.       Getlogint('gfile level',eurec.glevel,7);
  699.       getlogint('gfile points',eurec.gpoints,7);
  700.       end;
  701.       if gg='+' then begin
  702.       gox;
  703.       Defualt;
  704.       end;
  705.       If gg='1' then Begin
  706.       gox;
  707.       cpu:=eurec.nbu;
  708.       GetInt('Number Of Posts',cpu);
  709.       eurec.nbu:=cpu;
  710.       End;
  711.       If gg='2' then Begin
  712.       Gox;
  713.       cpu:=eurec.uploads;
  714.       GetInt('Number Of Uploads',cpu);
  715.       eurec.uploads:=cpu;
  716.       End;
  717.       If gg='3' then Begin
  718.       Gox;
  719.       cpu:=eurec.upkay;
  720.       Getint('Uploads K',cpu);
  721.       eurec.upkay:=cpu;
  722.       End;
  723.       If gg='4' then Begin
  724.       Gox;
  725.       cpu:=eurec.downloads;
  726.       GetInt('Number Of Downloads',cpu);
  727.       eurec.downloads:=cpu;
  728.       End;
  729.       If gg='5' then Begin
  730.       Gox;
  731.       cpu:=eurec.udkratio;
  732.       GetInt('New Required U/D ''K'' Ratio to download',cpu);
  733.       eurec.udkratio:=cpu;
  734.       End;
  735.       If gg='6' then Begin
  736.       gox;
  737.       cpu:=eurec.udratio;
  738.       GetInt('New Required U/D Ratio to download',cpu);
  739.       eurec.udratio:=cpu;
  740.       End;
  741.       If gg='7' then Begin
  742.       gox;
  743.       cpu:=eurec.PCRatio;
  744.       GetInt('New (P)ost (C)all (R)atio',cpu);
  745.       eurec.pcratio:=cpu;
  746.       End;
  747.       If gg='Z' then Begin
  748.       Gox;
  749.       EuSpecialNote;
  750.       End;
  751.    if gg='Q' then imdone:=true else imdone:=false;
  752.     gox;
  753.     Until Imdone;
  754.     end;
  755.  
  756. var q:integer;
  757.    tmp:integer;
  758. begin
  759.   writeurec;
  760.   seek (ufile,eunum);
  761.   read (ufile,eurec);
  762.   writelog (2,3,eurec.handle);
  763.   WriteStr(^F'Use '^A'ViSiON '^F'SysOp Full Screen User Editor? '^P'['^S'Y'^P']:*');
  764.   If input='' then input:='Y';
  765.   If yes then Begin
  766.      choose;
  767.      writeufile (eurec,eunum);
  768.      readurec;
  769.      exit;
  770.   end;
  771.   repeat
  772.    WriteLn(^M^R'['^S+Eurec.Handle+^R']');
  773.     q:=menu('User edit','UEDIT','SDHPLOEWTBQYNIA+CXGF!$^&J');
  774.     case q of
  775.       1:begin
  776.         showuserstats(eurec);
  777.         writelog(18,13,'');
  778.         if (DateStr(Eurec.ExpDate)='0/0/80') or (datestr(eurec.expdate)='0/0/128') then
  779.         writeln(^M'Users account does not expire!') else
  780.         writeln(^M'Account Expires on ',datestr(eurec.expdate));
  781.         end;
  782.       2:eudel;
  783.       3:euname;
  784.       4:eupassword;
  785.       5:eulevel;
  786.       6:getlogint ('u/d points',eurec.udpoints,7);
  787.       7:getlogint ('u/d level',eurec.udlevel,14);
  788.       8:euwanted;
  789.       9:getlogint ('time for today',eurec.timetoday,12);
  790.       10:boardflags;
  791.       12:specialsysop;
  792.       13:euphone;
  793.       14:begin
  794.           writestr(^M^P'Which infoform to view [1-5]: [1]:*');
  795.           if input='' then input:='1';
  796.           tmp:=valu(input);
  797.           if (tmp>0) and (tmp<6) then Begin
  798.            showinfoforms(strr(eunum),tmp);
  799.            WriteStr(^O'Press '^F'['^A'Enter'^F']:*');
  800.           end;
  801.          End;
  802.       15:euusernote;
  803.       16:begin
  804.           writestr ('Set to user defaults:');
  805.             if yes then begin
  806.               eurec.level:=configset.defleve;
  807.               eurec.usernote:=configset.defac;
  808.               eurec.udpoints:=configset.deffp;
  809.               eurec.udlevel:=configset.deffil;
  810.               eurec.glevel:=configset.defgfil;
  811.               eurec.gpoints:=configset.defgp;
  812.             end;
  813.         end;
  814.       17:euconference;
  815.       18:begin
  816.               if (datestr(eurec.expdate)='0/0/128') or (DateStr(Eurec.ExpDate)='0/0/80')
  817.                then writeln(^M^P'users account does not expire!') else
  818.                       writeln(^M^P'Users current Expiration date is '^R,datestr(eurec.expdate));
  819.               writestr(^M'Enter new expiration date, 00/00/80 for no expiration [mm/dd/yy]:');
  820.               eurec.expdate:=dateval(input);
  821.            end;
  822.      19:eglevel;
  823.      20:egfpoints;
  824.      21:eudratio;
  825.      22:eudkratio;
  826.      23:epcratio;
  827.      24:eutimelimit;
  828.      25:EuMainConference;
  829.      end
  830.   until hungupon or (q=11);
  831.   writeufile (eurec,eunum);
  832.   readurec
  833. end;
  834.  
  835.   Procedure printnews;
  836.     Var nfile:File Of newsrec;
  837.       line:Integer;
  838.       Ntmp:newsrec;cnt:Integer;
  839.     Begin
  840.       Assign(nfile,'News');
  841.       Reset(nfile);
  842.       If IOResult<>0 Then exit;
  843.       If FileSize(nfile)=0 Then Begin
  844.         Close(nfile);
  845.         exit
  846.       End;
  847.       clearscr;
  848.       if ansigraphics in urec.config then begin
  849.         blowup(1,1,27,3);
  850.         write(direct,#27,'[2;3H');
  851.       end;
  852.       writeln(^S'News: [Ctrl-X] to abort'^M^M^M);
  853.       cnt:=0;
  854.       While Not(EoF(nfile) Or break Or hungupon) Do Begin
  855.         Read(nfile,Ntmp);
  856.         If issysop or (ntmp.location>=0) And (ntmp.maxlevel>=urec.level) And (urec.level>=ntmp.level) Then Begin
  857.           inc(cnt);
  858.         WriteLn(^B'News Item #'^S,cnt,^R' - "'^S,ntmp.title,^R'" from '^S,ntmp.from,^R'');
  859.         WriteLn(^B'Date: ['^S,datestr(ntmp.when),^R']    Level ['^S,ntmp.level,' - ',ntmp.maxlevel,^R']');
  860.         WriteLn(^B^P'__________________________________________');
  861.           printtext(Ntmp.location);
  862.           writestr(^P'Press '^S'[Return]'^P' to continue.*')
  863.         End;
  864.       End;
  865.       Close(nfile)
  866.     End;
  867.  
  868.  
  869.  
  870. procedure openusfile;
  871. const newusers:userspecsrec=(name:'New users';Expired:True;minlevel:1;maxlevel:1;
  872.          minlaston:-maxint;maxlaston:maxint;minpcr:-maxint;maxpcr:maxint);
  873. begin
  874.   assign (usfile,'userspec');
  875.   reset (usfile);
  876.   if ioresult<>0 then begin
  877.     rewrite (usfile);
  878.     if configset.level2n<>0 then newusers.maxlevel:=configset.level2n;
  879.     write (usfile,newusers)
  880.   end
  881. end;
  882.  
  883. procedure editspecs (var us:userspecsrec);
  884.  
  885.   procedure get (tex:string; var value:integer; min:boolean);
  886.   var vstr:sstr;
  887.   begin
  888.     buflen:=6;
  889.     if abs(value)=maxint then vstr:='None' else vstr:=strr(value);
  890.     writestr (tex+' ['+vstr+']:');
  891.     if input[0]<>#0
  892.       then if upcase(input[1])='N'
  893.         then if min
  894.           then value:=-maxint
  895.           else value:=maxint
  896.         else value:=valu(input)
  897.   end;
  898.  
  899.   procedure getreal (tex:string; var value:real; min:boolean);
  900.   var vstr:sstr;
  901.       s:integer;
  902.   begin
  903.     buflen:=10;
  904.     if abs(value)=maxint then vstr:='None' else vstr:=streal(value);
  905.     writestr (tex+' ['+vstr+']:');
  906.     if length(input)<>0
  907.       then if upcase(input[1])='N'
  908.         then if min
  909.           then value:=-maxint
  910.           else value:=maxint
  911.         else begin
  912.           val (input,value,s);
  913.           if s<>0 then value:=0
  914.         end
  915.   end;
  916.  
  917. begin
  918.   writeln (^B^M'Enter specifications; N for none.'^M);
  919.   buflen:=30;
  920.   writestr ('Specification set name ['+us.name+']:');
  921.   if length(input)<>0
  922.     then if match(input,'N')
  923.       then us.name:='Unnamed'
  924.       else us.name:=input;
  925.   get ('Lowest level',us.minlevel,true);
  926.   get ('Highest level',us.maxlevel,true);
  927.   get ('Lowest #days since last call',us.minlaston,true);
  928.   get ('Highest #days since last call',us.maxlaston,true);
  929.   getreal ('Lowest post to call ratio',us.minpcr,true);
  930.   getreal ('Highest post to call ratio',us.maxpcr,true);
  931.   WriteStr('Search for expired accounts? *');
  932.   us.expired:=yes;
  933. end;
  934.  
  935. function getspecs (var us:userspecsrec):integer; { -1:not saved   >0:in file }
  936. begin
  937.   with us do begin
  938.     name:='Unnamed';                     { Assumes USFILE is open !! }
  939.     minlevel:=-maxint;
  940.     maxlevel:=maxint;
  941.     minlaston:=-maxint;
  942.     maxlaston:=maxint;
  943.     minpcr:=-maxint;
  944.     maxpcr:=maxint;
  945.     expired:=false;
  946.   end;
  947.   editspecs (us);
  948.   writestr (^M'Save these specs to disk? *');
  949.   if yes then begin
  950.     seek (usfile,filesize(usfile));
  951.     write (usfile,us);
  952.     getspecs:=filesize(usfile)
  953.   end else getspecs:=-1
  954. end;
  955.  
  956. function searchspecs (var us:userspecsrec; name:mstr):integer;
  957. var v,pos:integer;
  958. begin
  959.   v:=valu(name);
  960.   seek (usfile,0);
  961.   pos:=1;
  962.   while not eof(usfile) do begin
  963.     read (usfile,us);
  964.     if match(us.name,name) or (valu(name)=pos) then begin
  965.       searchspecs:=pos;
  966.       exit
  967.     end;
  968.     pos:=pos+1
  969.   end;
  970.   searchspecs:=0;
  971.   writestr (^M'Not found!')
  972. end;
  973.  
  974. procedure listspecs;
  975. var us:userspecsrec;
  976.     pos:integer;
  977.  
  978.   procedure writeval (n:integer);
  979.   begin
  980.     if abs(n)=maxint then write ('   None') else write(n:7)
  981.   end;
  982.  
  983.   procedure writevalreal (n:real);
  984.   begin
  985.     if abs(n)=maxint then write ('   None') else write(n:7:2)
  986.   end;
  987.  
  988. begin
  989.   writehdr ('User Specification Sets');
  990.   seek (usfile,0);
  991.   pos:=0;
  992.   tab ('',28);
  993.   tab('Expired',7);
  994.   tab ('    Level    ',14);
  995.   tab ('  Last Call  ',14);
  996.   writeln ('  Post/Call Ratio  ');
  997.   while not (break or eof(usfile)) do begin
  998.     pos:=pos+1;
  999.     read (usfile,us);
  1000.     write (pos:3,'. ');
  1001.     tab (us.name,23);
  1002.     if us.expired then tab(' Yes',7) else tab(' No',7);
  1003.     writeval (us.minlevel);
  1004.     writeval (us.maxlevel);
  1005.     writeval (us.minlaston);
  1006.     writeval (us.maxlaston);
  1007.     writevalreal (us.minpcr);
  1008.     writevalreal (us.maxpcr);
  1009.     writeln
  1010.   end
  1011. end;
  1012.  
  1013. function selectaspec (var us:userspecsrec):integer; {  0 = none         }
  1014. var done:boolean;                                   { -1 = not in file  }
  1015.     pos:integer;                                    { -2 = added to end }
  1016. begin
  1017.   selectaspec:=0;
  1018.   openusfile;
  1019.   if filesize(usfile)=0
  1020.     then selectaspec:=getspecs(us)
  1021.     else
  1022.       repeat
  1023.         if hungupon then exit;
  1024.         done:=false;
  1025.         writestr (^M'Specification set name (?=list, A=add):');
  1026.         if length(input)=0
  1027.           then done:=true
  1028.           else if match(input,'A')
  1029.             then
  1030.               begin
  1031.                 pos:=getspecs(us);
  1032.                 if pos>0
  1033.                   then selectaspec:=-2
  1034.                   else selectaspec:=-1;
  1035.                 done:=true
  1036.               end
  1037.             else if match(input,'?')
  1038.               then listspecs
  1039.               else
  1040.                 begin
  1041.                   pos:=searchspecs (us,input);
  1042.                   done:=pos<>0;
  1043.                   selectaspec:=pos
  1044.                 end
  1045.       until done;
  1046.   close (usfile)
  1047. end;
  1048.  
  1049. function selectspecs (var us:userspecsrec):boolean;
  1050. var dummy:integer;
  1051. begin
  1052.   dummy:=selectaspec (us);
  1053.   selectspecs:=dummy=0
  1054. end;
  1055.  
  1056. procedure deletespecs (pos:integer);
  1057. var cnt:integer;
  1058.     us:userspecsrec;
  1059. begin
  1060.   openusfile;
  1061.   for cnt:=pos to filesize(usfile)-1 do begin
  1062.     seek (usfile,cnt);
  1063.     read (usfile,us);
  1064.     seek (usfile,cnt-1);
  1065.     write (usfile,us)
  1066.   end;
  1067.   seek (usfile,filesize(usfile)-1);
  1068.   truncate (usfile);
  1069.   close (usfile)
  1070. end;
  1071.  
  1072. procedure editoldspecs;
  1073. var pos:integer;
  1074.     us:userspecsrec;
  1075. begin
  1076.   repeat
  1077.     pos:=selectaspec (us);
  1078.     if pos>0 then begin
  1079.       buflen:=1;
  1080.       writestr (^M'E)dit or D)elete? *');
  1081.       if length(input)=1 then case upcase(input[1]) of
  1082.         'E':begin
  1083.               editspecs (us);
  1084.               openusfile;
  1085.               seek (usfile,pos-1);
  1086.               write (usfile,us);
  1087.               close (usfile)
  1088.             end;
  1089.         'D':deletespecs (pos)
  1090.       end
  1091.     end
  1092.   until (pos=0) or hungupon
  1093. end;
  1094.  
  1095. procedure editusers;
  1096. var eunum:integer;
  1097.     matched:boolean;
  1098.  
  1099.   procedure elistusers (getspecs:boolean);
  1100.   var cnt,f,l:integer;
  1101.       u:userrec;
  1102.       us:userspecsrec;
  1103.  
  1104.     procedure listuser;
  1105.     begin
  1106.       write (cnt:4,' ');
  1107.       tab (u.handle,31);
  1108.       write (u.level:6,' ');
  1109.       tab (datestr(u.laston),8);
  1110.       write (u.nbu:6,u.numon:6,' ');
  1111.       if datestr(u.expdate)='0/0/80' then writeln('N/A') else writeln(datestr(u.expdate));
  1112.     end;
  1113.  
  1114.   begin
  1115.     if getspecs
  1116.       then if selectspecs(us)
  1117.         then exit
  1118.         else
  1119.           begin
  1120.             f:=1;
  1121.             l:=numusers
  1122.           end
  1123.       else parserange (numusers,f,l);
  1124.     seek (ufile,f);
  1125.     matched:=false;
  1126.     writeln (^B^M^M' Num Name                            Level ',
  1127.              'Last on  Posts Calls Exp Date');
  1128.     for cnt:=f to l do begin
  1129.       read (ufile,u);
  1130.       if (not getspecs) or fitsspecs(u,us) then begin
  1131.         listuser;
  1132.         matched:=true
  1133.       end;
  1134.       if break or xpressed then exit
  1135.     end;
  1136.     if not matched then
  1137.       if getspecs
  1138.         then writeln (^B^M'No users match specifications!')
  1139.         else writeln (^B^M'No users found in that range!')
  1140.   end;
  1141.  
  1142. procedure globalnew;
  1143. var cnt,f,l:integer;
  1144.     U:userrec;
  1145. begin
  1146. f:=1;
  1147. L:=numusers;
  1148. seek(ufile,f);
  1149. cnt:=0;
  1150. for f:=1 to l do begin
  1151.   read(ufile,u);
  1152.   if (u.level<=configset.level2n) and (u.handle<>'') then begin
  1153.    cnt:=cnt+1;
  1154.      writestr(^M^P'Edit ['^R+u.handle+^P'] ? *');
  1155.      if yes then begin
  1156.        edituser(f);
  1157.        seek(ufile,f+1);
  1158.        writeln(^B^U'Continuing with the scan...');
  1159.      end;
  1160.      end;
  1161.   end;
  1162. writeln(^B^R'End of user list! ['^P,cnt,^R'] Match(s) found!');
  1163. end;
  1164.  
  1165.  
  1166. begin
  1167.   repeat
  1168.     writestr (^M'User to edit [?,??=list], [N=Global New Users]:');
  1169.     if (length(input)=0) or (match(input,'Q')) then exit;
  1170.     if match(input,'N') then begin
  1171.        globalnew;
  1172.        exit;
  1173.     end;
  1174.     if input[1]='?'
  1175.       then elistusers (input='??')
  1176.       else begin
  1177.         eunum:=lookupuser (input);
  1178.         if eunum=0
  1179.           then writestr ('User not found!')
  1180.           else edituser (eunum)
  1181.       end
  1182.   until hungupon
  1183. end;
  1184.  
  1185. procedure zapspecifiedusers;
  1186. var us:userspecsrec;
  1187.     confirm:boolean;
  1188.     u:userrec;
  1189.     cnt:integer;
  1190.     done:boolean;
  1191. begin
  1192.   if selectspecs (us) then exit;
  1193.   writestr ('Confirm each deletion individually? *');
  1194.   if length(input)=0 then exit;
  1195.   confirm:=yes;
  1196.   if not confirm then begin
  1197.     writestr (^M'Are you SURE you want to mass delete without confirmation? *');
  1198.     if not yes then exit
  1199.   end;
  1200.   for cnt:=1 to numusers do begin
  1201.     seek (ufile,cnt);
  1202.     read (ufile,u);
  1203.     if (length(u.handle)>0) and fitsspecs (u,us) then begin
  1204.       if confirm
  1205.         then
  1206.           begin
  1207.             done:=false;
  1208.             repeat
  1209.               writestr ('Delete '+u.handle+' (Y/N/X/E):');
  1210.               if length(input)>0 then case upcase(input[1]) of
  1211.                 'Y':begin
  1212.                       done:=true;
  1213.                       writeln ('Deleting '+u.handle+'...');
  1214.                       deleteuser (cnt)
  1215.                     end;
  1216.                 'N':done:=true;
  1217.                 'X':exit;
  1218.                 'E':begin
  1219.                       edituser(cnt);
  1220.                       writeln;
  1221.                       writeln
  1222.                     end
  1223.               end
  1224.             until done
  1225.           end
  1226.         else
  1227.           begin
  1228.             writeln ('Deleting '+u.handle+'...');
  1229.             if break then begin
  1230.               writestr ('Aborted!!');
  1231.               exit
  1232.             end;
  1233.             deleteuser (cnt)
  1234.           end
  1235.     end
  1236.   end
  1237. end;
  1238.  
  1239. procedure showallsysops;
  1240. var n:integer;
  1241.     u:userrec;
  1242.     q:set of configtype;
  1243.     s:configtype;
  1244.  
  1245.   procedure showuser;
  1246.   const sectionnames:array [udsysop..databasesysop] of string[20]=
  1247.          ('File transfer','Bulletin section','Voting booths',
  1248.           'E-mail section','Doors','Main menu','Databases');
  1249.   var s:configtype;
  1250.   begin
  1251.     writeln (^B^M'Name:  '^S,u.handle,
  1252.                ^M'Level: '^S,u.level,^M);
  1253.     for s:=udsysop to databasesysop do
  1254.       if s in u.config then
  1255.         writeln ('Sysop of the ',sectionnames[s]);
  1256.     writestr (^M'Edit user? *');
  1257.     if yes then edituser (n)
  1258.   end;
  1259.  
  1260. begin
  1261.   q:=[];
  1262.   for s:=udsysop to databasesysop do q:=q+[s];
  1263.   for n:=1 to numusers do begin
  1264.     seek (ufile,n);
  1265.     read (ufile,u);
  1266.     if (u.level>=configset.sysopleve) or (q*u.config<>[]) then showuser
  1267.   end
  1268. end;
  1269.  
  1270. procedure readfeedback;
  1271. var ffile:file of mailrec;
  1272.     m:mailrec;
  1273.     me:message;
  1274.     cur:integer;
  1275.  
  1276.   function nummessages:integer;
  1277.   begin
  1278.     nummessages:=filesize(ffile)
  1279.   end;
  1280.  
  1281.   function checkcur:boolean;
  1282.   begin
  1283.     if length(input)>1 then cur:=valu(copy(input,2,255));
  1284.     if (cur<1) or (cur>nummessages) then begin
  1285.       writestr (^M'Message out of range!');
  1286.       cur:=0;
  1287.       checkcur:=true
  1288.     end else begin
  1289.       checkcur:=false;
  1290.       seek (ffile,cur-1);
  1291.       read (ffile,m)
  1292.     end
  1293.   end;
  1294.  
  1295.   procedure readnum (n:integer);
  1296.   begin
  1297.     cur:=n;
  1298.     input:='';
  1299.     if checkcur then exit;
  1300.     writeln (^M^R'Message: '^S,cur,
  1301.                ^M^R'Title:   '^S,m.title,
  1302.                ^M^R'Sent by: '^S,m.sentby,
  1303.                ^M^R'Sent on: '^S,datestr(m.when),' at ',timestr(m.when),^M);
  1304.     if break then exit;
  1305.     printtext (m.line)
  1306.   end;
  1307.  
  1308.   procedure writecurmsg;
  1309.   begin
  1310.     if (cur<1) or (cur>nummessages) then cur:=0;
  1311.     write (^B^M'Current msg: '^S);
  1312.     if cur=0 then write ('None') else begin
  1313.       seek (ffile,cur-1);
  1314.       read (ffile,m);
  1315.       write (m.title,' by ',m.sentby)
  1316.     end
  1317.   end;
  1318.  
  1319.   procedure delfeedback;
  1320.   var cnt:integer;
  1321.   begin
  1322.     if checkcur then exit;
  1323.     deletetext (m.line);
  1324.     for cnt:=cur to nummessages-1 do begin
  1325.       seek (ffile,cnt);
  1326.       read (ffile,m);
  1327.       seek (ffile,cnt-1);
  1328.       write (ffile,m)
  1329.     end;
  1330.     seek (ffile,nummessages-1);
  1331.     truncate (ffile);
  1332.     cur:=cur-1
  1333.   end;
  1334.  
  1335.   procedure editusr;
  1336.   var n:integer;
  1337.   begin
  1338.     if checkcur then exit;
  1339.     n:=lookupuser (m.sentby);
  1340.     if n=0
  1341.       then writestr ('User disappeared!')
  1342.       else edituser (n)
  1343.   end;
  1344.  
  1345.   procedure infoform;
  1346.   var info:integer;
  1347.   begin
  1348.     if checkcur then exit;
  1349.     writestr('What infoform to view [1-5]: [1]:*');
  1350.     if input='' then input:='1';
  1351.     info:=valu(input);
  1352.     if (info>0) and (info<6) then
  1353.     showinfoforms (m.sentby,info)
  1354.   end;
  1355.  
  1356.   procedure nextfeedback;
  1357.   begin
  1358.     cur:=cur+1;
  1359.     if cur>nummessages then begin
  1360.       writestr (^M'Sorry, no more feedback!');
  1361.       cur:=0;
  1362.       exit
  1363.     end;
  1364.     readnum (cur)
  1365.   end;
  1366.  
  1367.   procedure readagain;
  1368.   begin
  1369.     if checkcur then exit;
  1370.     readnum (cur)
  1371.   end;
  1372.  
  1373.   procedure replyfeedback;
  1374.   begin
  1375.     if checkcur then exit;
  1376.     sendmailto (m.sentby,false)
  1377.   end;
  1378.  
  1379.   procedure listfeedback;
  1380.   var cnt:integer;
  1381.   begin
  1382.     if nummessages=0 then exit;
  1383.     thereare (nummessages,'piece of feedback','pieces of feedback');
  1384.     if break then exit;
  1385.     writeln (^M'Num Title                          Left by'^M);
  1386.     seek (ffile,0);
  1387.     for cnt:=1 to nummessages do begin
  1388.       read (ffile,m);
  1389.       tab (strr(cnt),4);
  1390.       if break then exit;
  1391.       tab (m.title,31);
  1392.       writeln (m.sentby);
  1393.       if break then exit
  1394.     end
  1395.   end;
  1396.  
  1397. var q:integer;
  1398. label exit;
  1399. begin
  1400.   assign (ffile,configset.forumdi+'Feedback');
  1401.   reset (ffile);
  1402.   if ioresult<>0 then rewrite (ffile);
  1403.   cur:=0;
  1404.   repeat
  1405.     if nummessages=0 then begin
  1406.       writestr ('Sorry, no feedback!');
  1407.       goto exit
  1408.     end;
  1409.     writecurmsg;
  1410.     q:=menu ('Feedback','FEED','Q#DEIR_AL');
  1411.     if q<0
  1412.       then readnum (-q)
  1413.       else case q of
  1414.         3:delfeedback;
  1415.         4:editusr;
  1416.         5:infoform;
  1417.         6:replyfeedback;
  1418.         7:nextfeedback;
  1419.         8:readagain;
  1420.         9:listfeedback;
  1421.       end
  1422.   until (q=1) or hungupon;
  1423.   exit:
  1424.   close (ffile)
  1425. end;
  1426.  
  1427.  
  1428. Procedure RemoteDosShell;
  1429. Begin
  1430.     If ConfigSet.GatePass<>'' then
  1431.         Begin
  1432.             Dots:=True;
  1433.             WriteStr(^M^P'Dos Shell Password:');
  1434.             Dots:=False;
  1435.             If not match(input,configset.gatepass) then
  1436.                  Begin
  1437.                  WriteLn(^G^S'WRONG!'^M);
  1438.                  Exit;
  1439.                  End;
  1440.             End;
  1441.     ClearScr;
  1442.     WriteLog(2,13,TimeStr(Now));
  1443.     WriteLn(^S'Type "'^A'Exit'^S'" to return to ViSiON!');
  1444.     Delay(1000);
  1445.         closeport;
  1446.     Exec(GetEnv('Comspec'),'/C COMMAND < GATE'+STRR(Configset.UseCo)+' > GATE'+Strr(ConfigSet.UseCo));
  1447.     setparam(configset.useco,baudrate,false);
  1448.     ChDir(Copy(ConfigSet.ForumDi,1,Length(ConfigSet.ForumDi)-1));
  1449. End;
  1450.  
  1451. begin
  1452. end.
  1453.  
  1454.